<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.16"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>LibTools: H:/project/LibTools/src/log/LogStream.h 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">LibTools
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.16 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','搜索');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_2241064965c8d9ca993f08b926076f7d.html">log</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">LogStream.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_log_stream_8h.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef __LOGSTREAM_H__</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define __LOGSTREAM_H__</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include &quot;../thread/SharedPtr.h&quot;</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_safe_log_8h.html">SafeLog.h</a>&quot;</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;sstream&gt;</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160; </div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<a class="code" href="tools_8h.html#a201ce692c9dca6599e5c12d00167419b">DEF_BEG_LIBTOOLS</a></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160; </div>
<div class="line"><a name="l00012"></a><span class="lineno"><a class="line" href="class_c_log_stream.html">   12</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_c_log_stream.html">CLogStream</a></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;{</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;    <a class="code" href="class_c_log_stream.html#aec026290741afe0f09a8b9e5b932f1f0">delete_class_copy_operator</a>(<a class="code" href="class_c_log_stream.html">CLogStream</a>);</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00016"></a><span class="lineno"><a class="line" href="class_c_log_stream.html#a68ef82cf2cc3b904ea539e46b0a9efa0">   16</a></span>&#160;    <a class="code" href="class_c_log_stream.html#a68ef82cf2cc3b904ea539e46b0a9efa0">CLogStream</a>(<a class="code" href="class_c_safe_logs.html">CSafeLogs</a>* log, <a class="code" href="logdef_8h.html#aca1fd1d8935433e6ba2e3918214e07f9">LogLevel</a> level) : <a class="code" href="class_c_log_stream.html#a21c317afe9aaed273b42074eee910a79">_log</a>(log), <a class="code" href="class_c_log_stream.html#a1077b7aebe5df70801c0619100eee5e3">_level</a>(level){</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;    }</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160; </div>
<div class="line"><a name="l00019"></a><span class="lineno"><a class="line" href="class_c_log_stream.html#a25fb38848d0dbc0a0adac0d99fef25b6">   19</a></span>&#160;    <a class="code" href="class_c_log_stream.html#a25fb38848d0dbc0a0adac0d99fef25b6">~CLogStream</a>()</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;    {</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;        std::string str = <a class="code" href="tools_8h.html#acc6d8511211e23ff33647d261f6f8b59">STD_MOVE</a>(<a class="code" href="class_c_log_stream.html#aadd393c891c3ad4be607f58fd521eaee">_sstr</a>.str());</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;        <a class="code" href="class_c_log_stream.html#a21c317afe9aaed273b42074eee910a79">_log</a>-&gt;<a class="code" href="class_c_safe_logs.html#a67a16f7ebc22906bf159e3a8f88c5124">WriteLog</a>(str.data(), str.size(), <a class="code" href="class_c_log_stream.html#a1077b7aebe5df70801c0619100eee5e3">_level</a>);</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;    }</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160; </div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt;</div>
<div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="class_c_log_stream.html#a6784e2f86fbb8a469c959a841deab907">   26</a></span>&#160;    <span class="keyword">inline</span> <a class="code" href="class_c_log_stream.html">CLogStream</a>&amp; <a class="code" href="class_c_log_stream.html#a6784e2f86fbb8a469c959a841deab907">operator&lt;&lt; </a>(T log)</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;    {</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;        <a class="code" href="class_c_log_stream.html#aadd393c891c3ad4be607f58fd521eaee">_sstr</a> &lt;&lt; log;</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;        <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;    }</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="class_c_log_stream.html#a21c317afe9aaed273b42074eee910a79">   32</a></span>&#160;    <a class="code" href="class_c_safe_logs.html">CSafeLogs</a>* <a class="code" href="class_c_log_stream.html#a21c317afe9aaed273b42074eee910a79">_log</a>;</div>
<div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="class_c_log_stream.html#a1077b7aebe5df70801c0619100eee5e3">   33</a></span>&#160;    <a class="code" href="logdef_8h.html#aca1fd1d8935433e6ba2e3918214e07f9">LogLevel</a> <a class="code" href="class_c_log_stream.html#a1077b7aebe5df70801c0619100eee5e3">_level</a>;</div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="class_c_log_stream.html#aadd393c891c3ad4be607f58fd521eaee">   34</a></span>&#160;    std::stringstream <a class="code" href="class_c_log_stream.html#aadd393c891c3ad4be607f58fd521eaee">_sstr</a>;</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;};</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160; </div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<a class="code" href="tools_8h.html#ac909db71799bb22cb7d636a34cd785e4">DEF_END_LIBTOOLS</a></div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160; </div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#endif // __LOGSTREAM_H__</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="alogdef_8h_html_aca1fd1d8935433e6ba2e3918214e07f9"><div class="ttname"><a href="logdef_8h.html#aca1fd1d8935433e6ba2e3918214e07f9">LogLevel</a></div><div class="ttdeci">LogLevel</div><div class="ttdef"><b>Definition:</b> <a href="logdef_8h_source.html#l00010">logdef.h:10</a></div></div>
<div class="ttc" id="aclass_c_log_stream_html_aadd393c891c3ad4be607f58fd521eaee"><div class="ttname"><a href="class_c_log_stream.html#aadd393c891c3ad4be607f58fd521eaee">CLogStream::_sstr</a></div><div class="ttdeci">std::stringstream _sstr</div><div class="ttdef"><b>Definition:</b> <a href="_log_stream_8h_source.html#l00034">LogStream.h:34</a></div></div>
<div class="ttc" id="atools_8h_html_a201ce692c9dca6599e5c12d00167419b"><div class="ttname"><a href="tools_8h.html#a201ce692c9dca6599e5c12d00167419b">DEF_BEG_LIBTOOLS</a></div><div class="ttdeci">#define DEF_BEG_LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00036">tools.h:36</a></div></div>
<div class="ttc" id="aclass_c_safe_logs_html"><div class="ttname"><a href="class_c_safe_logs.html">CSafeLogs</a></div><div class="ttdoc">线程安全日志操作类</div><div class="ttdef"><b>Definition:</b> <a href="_safe_log_8h_source.html#l00018">SafeLog.h:18</a></div></div>
<div class="ttc" id="aclass_c_log_stream_html_a1077b7aebe5df70801c0619100eee5e3"><div class="ttname"><a href="class_c_log_stream.html#a1077b7aebe5df70801c0619100eee5e3">CLogStream::_level</a></div><div class="ttdeci">LogLevel _level</div><div class="ttdef"><b>Definition:</b> <a href="_log_stream_8h_source.html#l00033">LogStream.h:33</a></div></div>
<div class="ttc" id="aclass_c_log_stream_html_a21c317afe9aaed273b42074eee910a79"><div class="ttname"><a href="class_c_log_stream.html#a21c317afe9aaed273b42074eee910a79">CLogStream::_log</a></div><div class="ttdeci">CSafeLogs * _log</div><div class="ttdef"><b>Definition:</b> <a href="_log_stream_8h_source.html#l00032">LogStream.h:32</a></div></div>
<div class="ttc" id="aclass_c_log_stream_html_aec026290741afe0f09a8b9e5b932f1f0"><div class="ttname"><a href="class_c_log_stream.html#aec026290741afe0f09a8b9e5b932f1f0">CLogStream::delete_class_copy_operator</a></div><div class="ttdeci">delete_class_copy_operator(CLogStream)</div></div>
<div class="ttc" id="aclass_c_log_stream_html"><div class="ttname"><a href="class_c_log_stream.html">CLogStream</a></div><div class="ttdoc">内部使用的日志流类</div><div class="ttdef"><b>Definition:</b> <a href="_log_stream_8h_source.html#l00012">LogStream.h:12</a></div></div>
<div class="ttc" id="aclass_c_log_stream_html_a6784e2f86fbb8a469c959a841deab907"><div class="ttname"><a href="class_c_log_stream.html#a6784e2f86fbb8a469c959a841deab907">CLogStream::operator&lt;&lt;</a></div><div class="ttdeci">CLogStream &amp; operator&lt;&lt;(T log)</div><div class="ttdef"><b>Definition:</b> <a href="_log_stream_8h_source.html#l00026">LogStream.h:26</a></div></div>
<div class="ttc" id="atools_8h_html_ac909db71799bb22cb7d636a34cd785e4"><div class="ttname"><a href="tools_8h.html#ac909db71799bb22cb7d636a34cd785e4">DEF_END_LIBTOOLS</a></div><div class="ttdeci">#define DEF_END_LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00038">tools.h:38</a></div></div>
<div class="ttc" id="aclass_c_log_stream_html_a68ef82cf2cc3b904ea539e46b0a9efa0"><div class="ttname"><a href="class_c_log_stream.html#a68ef82cf2cc3b904ea539e46b0a9efa0">CLogStream::CLogStream</a></div><div class="ttdeci">CLogStream(CSafeLogs *log, LogLevel level)</div><div class="ttdef"><b>Definition:</b> <a href="_log_stream_8h_source.html#l00016">LogStream.h:16</a></div></div>
<div class="ttc" id="aclass_c_log_stream_html_a25fb38848d0dbc0a0adac0d99fef25b6"><div class="ttname"><a href="class_c_log_stream.html#a25fb38848d0dbc0a0adac0d99fef25b6">CLogStream::~CLogStream</a></div><div class="ttdeci">~CLogStream()</div><div class="ttdef"><b>Definition:</b> <a href="_log_stream_8h_source.html#l00019">LogStream.h:19</a></div></div>
<div class="ttc" id="aclass_c_safe_logs_html_a67a16f7ebc22906bf159e3a8f88c5124"><div class="ttname"><a href="class_c_safe_logs.html#a67a16f7ebc22906bf159e3a8f88c5124">CSafeLogs::WriteLog</a></div><div class="ttdeci">fsize_t WriteLog(const char *szLog, fsize_t size, LogLevel nLogLevel)</div><div class="ttdef"><b>Definition:</b> <a href="_safe_log_8cpp_source.html#l00082">SafeLog.cpp:82</a></div></div>
<div class="ttc" id="atools_8h_html_acc6d8511211e23ff33647d261f6f8b59"><div class="ttname"><a href="tools_8h.html#acc6d8511211e23ff33647d261f6f8b59">STD_MOVE</a></div><div class="ttdeci">#define STD_MOVE(object)</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00043">tools.h:43</a></div></div>
<div class="ttc" id="a_safe_log_8h_html"><div class="ttname"><a href="_safe_log_8h.html">SafeLog.h</a></div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.16
</small></address>
</body>
</html>
